<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@include file="../common.jsp" %>
<script type="text/javascript"> 			
				function add(){
				
				var uname = document.getElementById("name");
				var password = document.getElementById("pwd");
				var dept = document.getElementById("dept_id");
			
				var value1 = uname.value;
				var value2 = password.value;
				var value3 = dept.value;
			
				if(value1==null||value1==""){
					document.getElementById("name_msg").innerHTML = "*姓名不能为空";
					 return false;
				}else{
					document.getElementById("name_msg").innerHTML = "";
				}
				if(value2==null||value2==""){
					document.getElementById("pwd_msg").innerHTML = "*密码不能为空";
					return  false;
				}else{
					document.getElementById("pwd_msg").innerHTML = "";
				}  
				if(value3==null||value3==""){
					document.getElementById("dept_msg").innerHTML = "*请选择部门";
					return  false;
				}else{
					document.getElementById("dept_msg").innerHTML = "";
				}
			}
		</script>
		<form name="newEmpAdd" method="post" action="../emp/newEmpAddAction.action"  onsubmit="return add()">
	     <div id="content_right">
						<br />
						<br />
						<br />
						
							<table cellpadding="0" cellspacing="1" border="0"
								class="form_table1">
								<tr>
									<td>
										&nbsp;&nbsp;&nbsp;&nbsp;姓名 ：
									</td>
									<td>
										<input type="text" id="name" name="name" value="" class="inputgri" onblur="add()"
										 onpropertychange="with(this)if(/[^\u3447-\uFA29]/ig.test(value))value=value.replace(/[^\u3447-\uFA29]/ig,'')"/> 
										&nbsp;
									</td>
									<td id="d1">
									<font id="name_msg" color="red" size="2"></font></td>
								</tr>
								<tr>
									<td>
										&nbsp;&nbsp;&nbsp;&nbsp;密码 ：
									</td>
									<td>
										<input type="password" id="pwd" name="pwd" value="" class="inputgri" size="21" onblur="add()"/>
										&nbsp;
										
									</td>
									<td id="d2">
									<font id="pwd_msg" color="red" size="2"></font></td>
								</tr>
								<tr>
									<td>
										&nbsp;&nbsp;&nbsp;所属部门 ：
									</td>
									<td>
										<select id="dept_id" name="deptId"  onblur="add()"/>
										<option value="">
								
										</option>
										<c:forEach items="${list}" var="Department">
										<option id="${Department.deptId}" value="${Department.deptId}"  >
												&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;${Department.deptId}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
											</option>
										</c:forEach>
										</select>
									</td>
									<td id="d3">
									<font id="dept_msg" color="red" size="2"></font></td></td>
								</tr>
								<tr>
									<td>
										&nbsp;&nbsp;&nbsp;人员类型 ：
									</td>
									<td>
										<font color="red" size="2">默认为普通员工</font>
									</td>
									<td id="d4"></td>
								</tr>
								<tr>
									<td>
										&nbsp;&nbsp;&nbsp;人员电话 ：
									</td>
									<td>
										<input type="text" id="mobile" name="mobile" value="" class="inputgri" />
										&nbsp;
										<font color="red" size="2"></font>
									</td>
									<td id="d5"></td>
								</tr>
								<tr>
									<td>
										&nbsp;&nbsp;&nbsp;电子邮件 ：
									</td>
									<td>
										<input type="text" name="email" value="" class="inputgri" />
										&nbsp;
										<font color="red" size="2"></font>
									</td>
									 <td>
				                        </td>
								</tr>
								<tr>
									<td>
										&nbsp;&nbsp;&nbsp;人员手机 ：
									</td>
									<td>
										<input type="text" name="telephone" value="" class="inputgri" />
										&nbsp;
										<font color="red" size="2"></font>
								    <td>
								    
				                    </td>
								</tr>
								<tr>
									<td>
										&nbsp;&nbsp;&nbsp;人员角色 ：
									</td>
									<td>
										
										<font color="red" size="2">暂无添加</font>
				                       <td></td>
								</tr>
								<tr>
									<td>
										&nbsp;&nbsp;&nbsp;人员备注 ：
									</td>
									<td>
										<textarea name="remark" rows="3" class="inputgri"></textarea>
										&nbsp;
										<font color="red" size="2"></font>
									</td>
									<td id="d8"></td>
								</tr>
							</table>
							
							<p align="center">
							<font color="red" size="2">${msg }</font>
								<input type="submit" class="button" value="提交 &raquo; " />
								&nbsp;
								&nbsp;
								&nbsp;
								<input type="reset" class="button" value="重置 &raquo;" />
								&nbsp;
							</p>
					
						<br />
							
						<br />
					</div>
					</form>
